package com.corpgovernment.common.apollo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author yh_yin
 */
@Component
public class JobCenterApollo extends CommonApollo {

    /**
     * 调度中心地址
     */
    @Value("${xxl.job.admin.addresses:}")
    private String xxlJobAdminAddresses;
    /**
     * 通讯token
     */
    @Value("${xxl.job.accessToken:}")
    private String xxlJobAccessToken;
    /**
     * 执行器名字
     */
    @Value("${xxl.job.executor.appname:}")
    private String xxlJobExecutorAppname;
    /**
     * 执行器地址
     */
    @Value("${xxl.job.executor.address:}")
    private String xxlJobExecutorAddress;
    /**
     * 执行器IP
     */
    @Value("${xxl.job.executor.ip:}")
    private String xxlJobExecutorIp;
    /**
     * 执行器端口
     */
    @Value("${xxl.job.executor.port:9898}")
    private int xxlJobExecutorPort;
    /**
     * 执行器文件存储路径
     */
    @Value("${xxl.job.executor.logpath:}")
    private String xxlJobExecutorLogpath;
    /**
     * 日志文件保存天数
     */
    @Value("${xxl.job.executor.logretentiondays:0}")
    private int xxlJobExecutorLogretentiondays;
    /**
     * 自动取消时间
     */
    @Value("${orderAutoCancelTime:30}")
    private int orderAutoCancelTime;
    /**
     * 代理人查询页数
     */
    @Value("${agent_check_task_count:20}")
    private int agentCheckTaskCount;

    @Value("${hotelBasicDataUrl:}")
    private String hotelBasicDataUrl;

    public String getHotelBasicDataUrl() {
        return getAppProperty("hotelBasicDataUrl", "");
    }
    /**
     * 调度中心地址
     */
    public String getXxlJobAdminAddresses() {
        return getAppProperty("xxl.job.admin.addresses", "");
    }
    /**
     * 通讯token
     */
    public String getXxlJobAccessToken() {
        return getAppProperty("xxl.job.accessToken", "");
    }
    /**
     * 执行器名字
     */
    public String getXxlJobExecutorAppname() {
        return getAppProperty("xxl.job.executor.appname", "");
    }
    /**
     * 执行器地址
     */
    public String getXxlJobExecutorAddress() {
        return getAppProperty("xxl.job.executor.address", "");
    }
    /**
     * 执行器IP
     */
    public String getXxlJobExecutorIp() {
        return getAppProperty("xxl.job.executor.ip", "");
    }
    /**
     * 执行器端口
     */
    public int getXxlJobExecutorPort() {
        return Integer.parseInt(getAppProperty("xxl.job.executor.port", "9898"));
    }
    /**
     * 执行器文件存储路径
     */
    public String getXxlJobExecutorLogpath() {
        return getAppProperty("xxl.job.executor.logpath", "");
    }
    /**
     * 日志文件保存天数
     */
    public int getXxlJobExecutorLogretentiondays() {
        return Integer.parseInt(getAppProperty("xxl.job.executor.logretentiondays", "0"));
    }
    /**
     * 自动取消时间
     */
    public int getOrderAutoCancelTime() {
        return Integer.parseInt(getAppProperty("orderAutoCancelTime", "30"));
    }
    /**
     * 代理人查询页数
     */
    public int getAgentCheckTaskCount() {
        return Integer.parseInt(getAppProperty("agent_check_task_count", "20"));
    }

}
